<?php
namespace app\admin\validate;
use think\Validate;
class User extends Validate{
	//会员验证
	
    protected $rule = [
        'username'  =>  'require|max:20|unique:user',
        'password' =>  'require',
    ];
	
    protected $message  =   [
        'username.require' => '会员账号必须填写',
        'username.max' => '会员名称长度不得大于20位',
        'username.unique' => '会员账号不得重复',
        'password.require' => '会员密码必须填写',
    ];

    protected $scene = [
        'add'  =>  ['username','password'],
        'edit'  =>  ['username'],
    ];

}
